/*
*   门店管理
* */
import React,{Component} from 'react';
import Util from '../common/util'
import ShopAchieve from './achievement/shopAchieve';
import ShopFans from './userFans/shopList';//门店粉丝
import ShopList from './shop/shopList';//门店列表
import ClerkShopList from './clerk/shopList';//店员管理-门店列表
import OrderList from './distribution/orderList';//配送订单列表
import {
    View,
    Text,
    Image,
    TouchableOpacity,
    Animated,
    StyleSheet
} from 'react-native';
import * as URLconstant from '../constant/URLconstant'
export default class shopManager extends Component{
    // 构造
      constructor(props) {
        super(props);
        // 初始状态
        this.state = {

        };
      }

        toAchieve(title){
          this.props.navigator.push({
              component:ShopAchieve,
              passProps:{
                  user_id:this.props.user_id,
                  title:title
              }
          })
        }

        linkJump(jump){
          this.props.navigator.push({
              component:jump,
              passProps:{
                  user_id:this.props.user_id,
              }
          })
        }


    toOrderList(){
          this.props.navigator.push({
              component:OrderList,
              passProps:{
                  user_id:this.props.user_id,
                  shop_id:this.props.shop_id,
                  role_id:this.props.role_id,
                  order_type:0,
                  delivery_status:0
              }
          })
    }

      render(){
          let deliveryOrder = this.props.data
          return(
              <View style={{marginTop:10,backgroundColor:"#fff"}}>
                <View style={styles.header_view}>
                    <Image
                        source={require('../imgs/center_icon19.png')}
                        style={{width:25,height:25,marginRight:5}}
                        resizeMode={'cover'}
                    />
                    <Text style={{fontSize:14,color:"#333"}}>门店管理</Text>
                </View>
                  <View style={styles.four_view}>
                      <TouchableOpacity onPress={()=>this.linkJump(ShopList)} style={styles.manager_item}>
                          <Image
                              source={require('../imgs/center_icon20.png')}
                              style={{width:20,height:20,marginBottom:5}}
                              resizeMode={'cover'}
                          />
                          <Text style={{fontSize:14,color:"#333"}}>门店列表</Text>
                      </TouchableOpacity>
                      <TouchableOpacity onPress={()=>this.linkJump(ClerkShopList)} style={styles.manager_item}>
                          <Image
                              source={require('../imgs/centerdy.png')}
                              style={{width:20,height:20,marginBottom:5}}
                              resizeMode={'cover'}
                          />
                          <Text style={{fontSize:14,color:"#333"}}>店员管理</Text>
                      </TouchableOpacity>
                      <TouchableOpacity onPress={()=>this.toAchieve('门店业绩')} style={styles.manager_item}>
                          <Image
                              source={require('../imgs/mendianyeji.png')}
                              style={{width:20,height:20,marginBottom:5}}
                              resizeMode={'cover'}
                          />
                          <Text style={{fontSize:14,color:"#333"}}>门店业绩</Text>
                      </TouchableOpacity>
                      <TouchableOpacity onPress={()=>this.linkJump(ShopFans)} style={styles.manager_item}>
                          <Image
                              source={require('../imgs/tuandui.png')}
                              style={{width:20,height:20,marginBottom:5}}
                              resizeMode={'cover'}
                          />
                          <Text style={{fontSize:14,color:"#333"}}>门店粉丝</Text>
                      </TouchableOpacity>
                      <TouchableOpacity onPress={()=>this.toOrderList()} style={styles.manager_item}>
                          <View  style={{height:20,marginBottom:5,alignItems:'center',justifyContent:'center',}}>
                              <Text style={{fontSize:16,color:"#f00"}}>{deliveryOrder.shopOrderNum}</Text>
                          </View>
                          <Text style={{fontSize:14,color:"#333"}}>门店订单</Text>
                      </TouchableOpacity>
                  </View>
              </View>
          )
      }
}
var styles = StyleSheet.create({
    header_view:{
        height:40,
        paddingHorizontal:10,
        borderBottomColor:"#e0e0e0",
        borderBottomWidth:1,
        flexDirection:'row',
        alignItems:'center'
    },
    four_view:{
        flexDirection:'row',
        alignItems:'center',
        flexWrap:'wrap'
    },
    manager_item:{
        alignItems:'center',
        justifyContent:'center',
        width:Util.size.width/4,
        paddingVertical:10
    }
})